import React from 'react';
import { createRoot } from 'react-dom/client';
function App(props){
    //hello props.children='hello'
    //props.children = ['hello',span element,'world'];
    //props.children = function
    //组件的儿子保在props.children里
    //它的值可能是一个字符串，也可能是一个函数，也可能是一个React元素
    //也可能是一个数组，里面放置各种各样的值
    //props.children
    //props.children.forEach is not a function
/*     if(Array.isArray(props.children)){
        props.children.forEach((child)=>{
            console.log(child)
        });
    }else{
        console.log(props.children)
    } */
    React.Children.forEach(props.children,(child)=>console.log(child));
    return (
        <div>

        </div>
    )
}
let element = (
    <App>
                1
        <span>2</span>
        3
    </App>
)
console.log(element)
let root = createRoot(document.getElementById('root'))
root.render(element);
